package ui.Config;

import ui.Frame.JFrameGame;
import ui.Frame.WaitFrame;
import util.FrameUtil;

import javax.swing.*;
import java.awt.*;
import java.util.concurrent.TimeUnit;

/**
 * @author Hujf
 * @title: FrameConfig
 * @date 2021/2/14 0014下午 4:06
 * @description: TODO
 */
public class FrameConfig extends JFrame {

    /**
     *
     * 主面板
     *
     * */
    private JFrameGame jFrameGame;
    public FrameConfig( JFrameGame frame) {
        this.jFrameGame = frame;
        this.setTitle("用户数据设定");
        this.setLayout(new BorderLayout());
        this.setSize(600,600);
        this.setResizable(false);
        FrameUtil.setFrameCenter(this);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        // 添加主面板
        this.add(this.createMainPanel(), BorderLayout.CENTER);

        this.setVisible(true);
    }

    /**
     * 添加主面板屬性
     */
    /**
     * 选项卡
     * */
    private JTabbedPane tabs;

    private JTabbedPane createMainPanel() {
        this.tabs = new JTabbedPane();
        this.tabs.setOpaque(false);
        this.tabs.add("人物设置", this.createPlayerSelectPanel());
       // this.tabs.setToolTipTextAt(0, "完成人物设置");
//        this.tabs.add("场景设置", this.createMapSelectPanel());
//        this.tabs.setToolTipTextAt(1, "可以设置游戏场景");
//        this.tabs.add("游戏设置", this.createGameSelectPanel());
//        this.tabs.setToolTipTextAt(2, "可以设置游戏胜利条件等...");
        return tabs;
    }
    private JButton b;
    private JPanel createPlayerSelectPanel() {
        JPanel jp = new JPanel();
        jp.setLayout(null);
        jp.setBackground( Color.red);
        // 增加重置按钮
        b = new JButton("sadasd");
        b.setBounds(256 + 7, 235, 80, 30);
        jp.add(b);
        return jp;
    }


}
